package demo1;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-09-09
 * Time: 22:28
 */

class Student extends Thread{
    @Override
    public void run() {
        System.out.println("haha1");
    }
}
class Teacher implements Runnable{
    @Override
    public void run() {
        System.out.println("haha2");
    }
}
public class Test2 {
    public static void main(String[] args) {
        Student student = new Student();//1
        student.start();
        Thread thread2 = new Thread(new Teacher());//2
        thread2.start();
        Thread thread3 = new Thread(){
            @Override
            public void run() {
                System.out.println("haha3");
            }
        };//3
        thread3.start();
        Thread thread4 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("haha4");
            }
        });//4
        thread4.start();
        Thread thread5 = new Thread(() -> {
            System.out.println("haha5");
        });
        thread5.start();
        Thread thread6 = new Thread(() -> {
            System.out.println("hehe");
        });
        thread6.getId();
        thread6.getName();
        thread6.getState();
        thread6.getPriority();
        thread6.isAlive();
        thread6.isDaemon();
        thread6.isInterrupted();
    }
}
